-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-24150 Ability to have different prefixes for exceptions #4991
base: main
Are you sure you want to change the base?
Conversation
modules/api/src/main/java/org/apache/ignite/lang/ErrorGroup.java
Outdated
Show resolved
Hide resolved
/** Group name. */ | ||
private final String groupName; | ||
|
||
/** Group code. */ | ||
private final short groupCode; | ||
|
||
/** Additional prefix that is used in a human-readable format of error messages. */ | ||
private final String errorPrefix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm a little confused by the name. Perhaps, it would be nice to change to groupNamePrefix
, or vendorSpecificPrefix
etc. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we honestly it's not so important and all variants reflect nature of the field but from different perspective
* @param message Original message. | ||
* @return New error message with predefined prefix. | ||
*/ | ||
static String errorMessage(String errorPrefix, UUID traceId, String groupName, int code, String message) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I don't like this idea. I mean creating a new class with duplicating code looks odd to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4991 (comment)
We have two chairs here -introduce in public API method which not required for user and can be used wrong or make a small duplication.
|
||
/** | ||
* Defines error groups and its errors. | ||
*/ | ||
@SuppressWarnings("PublicInnerClass") | ||
public class ErrorGroups { | ||
/** Additional prefix that is used in a human-readable format of ignite errors. */ | ||
public static final String IGNITE_ERR_PREFIX = "IGN"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, the following code should be updated as well
public const string ErrPrefix = "IGN-"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
https://issues.apache.org/jira/browse/IGNITE-24150